﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace pb_ws_client
{
    public partial class login : Form
    {
        public login()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo(LogicLayer.Web);
            System.Diagnostics.Process.Start(LogicLayer.Web); 
        }

        private void button2_Click(object sender, EventArgs e)
        {
            WebServiceReference.AppServiceSoapClient wsr = new WebServiceReference.AppServiceSoapClient();
            string result = wsr.Login(textBox1.Text, textBox2.Text);
            if (result != null)
            {
                LogicLayer.SID = result;
                LogicLayer.UID = textBox1.Text;
                this.Hide();
                main mainForm = new main();
                mainForm.Show();

            }
            else
            {
                MessageBox.Show("用户验证失败。", "提示");

            }
            textBox2.Text = "";

        }

        private void login_Load(object sender, EventArgs e)
        {

        }
    }
}
